package com.yunhe.option.domain.data;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.yunhe.option.domain.data.pk.WeatherPK;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.*;
import java.util.Date;

/**
 * 气候数据对象
 * @author liuronglei
 */
@ApiModel(value = "Weather", description = "气候状态对象")
@Entity
@IdClass(WeatherPK.class)
@Table(name = "data_weather")
public class Weather {
    @Id
    @Column(name = "area_code")
    private Long areaCode;
    @ApiModelProperty(value = "时间", example = "2017-12-06 00:00:00")
    @Id
    @Column(name = "dtime")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date dtime;
    @Column(name = "wind_speed")
    private Double windSpeed;
    @Column(name = "temperature")
    private Double temperature;
    @Column(name = "solar_irradiance")
    private Double solarIrradiance = 0D; //因为日照强度暂时获取不到，所以给默认值为0
    @Column(name = "weather")
    private String weather;

    public Double getWindSpeed() {
        return windSpeed;
    }

    public void setWindSpeed(Double windSpeed) {
        this.windSpeed = windSpeed;
    }

    public String getWeather() {
        return weather;
    }

    public void setWeather(String weather) {
        this.weather = weather;
    }

    public Long getAreaCode() {
        return areaCode;
    }

    public void setAreaCode(Long areaCode) {
        this.areaCode = areaCode;
    }

    public Date getDtime() {
        return dtime;
    }

    public void setDtime(Date dtime) {
        this.dtime = dtime;
    }

    public Double getTemperature() {
        return temperature;
    }

    public void setTemperature(Double temperature) {
        this.temperature = temperature;
    }

    public Double getSolarIrradiance() {
        return solarIrradiance;
    }

    public void setSolarIrradiance(Double solarIrradiance) {
        this.solarIrradiance = solarIrradiance;
    }
}
